package simple_factory_model;
//创建型模式
public class Simple_factory_model {
    public static void main(String[] args){
        //Factory factory=new Factory();
        Factory factor=new AFactory();
        //Factory factor=(Factory)XMLUtil.getBean();
        Fruit fruitA=factor.CreateFruit();
        //Fruit fruit=factory.CreateFruit("B");
        //fruit.eat();
        fruitA.eat();
    }
    String factory(String fruitname){
        if(fruitname.equals("Apple"))
            return "Apple";
        if(fruitname.equals("Banana"))
            return "Banana";
        return null;
    }
}
